/*****************************************************************************
 * $Workfile:: option_adjust.h                                               $
 * $Revision:: 1                                                             $
 * $JustDate::  1/27/12                                                      $
 *
 *      GENIE V ECU
 *      option adjust
 *****************************************************************************/

#ifndef GENIE_OPTION_ADJUST
#define GENIE_OPTION_ADJUST

#define OFF_BIT   0x80

struct OAD
{
	enum
	{
		SC = 0
		, SC_SHOW
		, SHOW_VALUE
		, HIGH_NIBBLE
		, LOW_NIBBLE
		, SHOW_VALUE1
		, VERIFY
		, WRITE_FAULT
		, DATA0
		, DATA1 
		, DATA2
		, DATA3
		, DATA4
		, DATA5
		, DATA6
		, DATA7
		, DATA8	
		// display states
		, SC_OFF          = (SC          | OFF_BIT)
		, SC_SHOW_OFF     = (SC_SHOW     | OFF_BIT)
		, SHOW_VALUE_OFF  = (SHOW_VALUE  | OFF_BIT)
		, HIGH_NIBBLE_OFF = (HIGH_NIBBLE | OFF_BIT)
		, LOW_NIBBLE_OFF  = (LOW_NIBBLE  | OFF_BIT)
		, SHOW_VALUE1_OFF = (SHOW_VALUE1 | OFF_BIT)
		, VERIFY_OFF      = (VERIFY      | OFF_BIT)
		, WRITE_FAULT_OFF = (WRITE_FAULT | OFF_BIT)			  
	} eState, eFlashState;
	UINT16 wFlashTimer;
	UINT16 wHornOnTimer;
	UINT16 wHornOnTimer2;
	UINT8  bHighNibble;
	UINT8  bLowNibble;
	UINT16 wOption;
	UINT8  fLift: 1;
	UINT8  fRight: 1;
	UINT8  fLeft: 1;
	UINT8  fHigh: 1;
	UINT8  fHorn: 1;
	
	UINT8 u8DataNum: 3;
	UINT8 u8EN: 1;
	UINT16 bFlashTimer2;
	UINT8 u8_Button_EN: 1;
	
};

extern struct OAD OAD_Local;
extern  const  UINT16  awCodeToDisplay[72];
extern void option_adjust(void);
extern void GPS_unlock_temporary_randomcode_display(void);
extern void GPS_unlock_temporary_checkcode_display(void);
extern UINT8 Check_Option_Code(UINT16 OptionCodeValue);

#endif // GENIE_OPTION_ADJUST
